
/*
    包含n个reducer函数的模块
 */
import {combineReducers} from 'redux'
import {INCREMENT,DECREMENT} from './action-types'
function counter(count = 0,action) {
    switch (action.type) {
        case INCREMENT:
            return count + action.data
        case DECREMENT:
            return count - action.data
        default:
            return count
    }
}
// 有多个时可以同意暴露 store.js 里面引入方式要改变
export default combineReducers({
    counter
})

